import { BadRequestException } from '@nestjs/common'

export const validateEmail = (email: string): void => {
  const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/
  if (!emailRegex.test(email)) {
    throw new BadRequestException('邮箱格式不正确')
  }
}
